//
//  NYSettingView.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2017/12/25.
//  Copyright © 2017年 niuwaketang. All rights reserved.
//

#import "NYSettingView.h"

@interface NYSettingView ()

@end
@implementation NYSettingView

- (void)setupTableView
{
        [self addSubview:self.bottomView];
        
        [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
                
                if (@available(iOS 11.0,*))
                {
                        make.top.equalTo(self);
                        make.left.equalTo(self.mas_safeAreaLayoutGuideLeft);
                        make.right.equalTo(self.mas_safeAreaLayoutGuideRight);
                }
                else
                {
                        make.top.equalTo(self);
                        make.left.right.equalTo(self);
                }
        }];
        [self.bottomView mas_remakeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(self.tableView.mas_bottom);
                make.left.right.equalTo(self.tableView);
                make.height.mas_equalTo(60);
                if (@available(iOS 11.0,*))
                {
                        make.bottom.equalTo(self.mas_safeAreaLayoutGuideBottom);
                }
                else
                {
                        make.bottom.equalTo(self.controller.mas_bottomLayoutGuideTop);
                }
        }];
}

- (NYCommonBottomView *)bottomView
{
        if (_bottomView == nil) {
                _bottomView = [[NYCommonBottomView alloc] init];
                [_bottomView.actionButton setTitle:@"退出登录" forState:(UIControlStateNormal)];
        }
        return _bottomView;
}
@end
